package org.example.business.endpoint;

import lombok.extern.slf4j.Slf4j;
import org.example.business.Events;
import org.example.business.endpoint.http.HttpServer;
import org.example.objevent.event.EventActor;
import org.example.objevent.event.EventBus;
import org.example.objevent.executor.EventExecutor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.concurrent.TimeUnit;

@Slf4j
@Component
public class StartServerActor implements EventActor<ServerOptions> {

    @Autowired
    private EventBus bus;

    @Autowired
    private EventExecutor executor;

    @Autowired
    private HttpServer httpServer;

    @Override
    public String getWatchEvent() {
        return Events.Startup;

    }

    @Override
    public void act(ServerOptions data) {
        httpServer.startup();

    }

}
